// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Vant from 'vant'
Vue.use(Vant)
import 'vant/lib/vant-css/index.css';

// 文字头像引用
// import { avatardirective } from 'namedavatar/vue'

// Vue.directive('avatar',avatardirective)
import Vuex from 'vuex'
Vue.use(Vuex)

import vueresource from 'vue-resource'
Vue.use(vueresource)

Vue.config.productionTip = false

/* eslint-disable no-new */

Vue.http.options.emulateJSON = true//不使用json发送数据

const store = new Vuex.Store({
  state: {
    navactive: 0,
    unread:false,
    show: true,
    user: '',
    messages:{
      haveNew: false,
      list:[]
    },
    notification:[]
  },
  mutations: {
    hideTab (state) {
      state.show = false
    },
    showTab(state){
      state.show = true
    },
    getUser(state){
      return state.user
    },
    setUser(state,user){
      state.user= user
    }
  }
})

new Vue({
  el: '#app',
  store,
  router,
  components: { App },
  template: '<App/>'
})





